package com.woniu.malltinyone.controller;

import com.woniu.malltinyone.common.CommonResult;
import com.woniu.malltinyone.service.UmsMemberService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/sso")
@Api(tags = "UmsMemberController",description = "会员登录注册管理")
public class UmsMemberController {
    @Autowired
    private UmsMemberService memberService;
    @GetMapping(value = "/getAuthCode")
    @ApiOperation("获取验证码")
    public CommonResult getAuthCode(@RequestParam String telephone){
        CommonResult commonResult = memberService.generateAuthCode(telephone);
        return commonResult;
    }
    @ApiOperation("判断验证码是否正确")
    @PostMapping(value = "/verifyAntuCode")
    public CommonResult verifyAntuCode(String telephone,String authcode){
        CommonResult commonResult = memberService.verifyAuthCode(telephone, authcode);
        return commonResult;
    }
}
